package com.courier;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author mohan lau
 * @version 1.0
 * @ClassName: CourierApplicationStart
 * @Description: TODO 启动类
 * @Date: 2021-05-07 15:31
 */
@EnableWebSocket
@SpringBootApplication
@MapperScan("com.courier.dao")
public class CourierApplicationStart {
    public static void main(String[] args) {

        SpringApplication.run(CourierApplicationStart.class, args);
    }

    /**
     * 检测所有带有@serverEndpoint注解的bean并注册他们（websocket服务进行发布）。
     * @return
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        System.out.println("我被注入了");
        return new ServerEndpointExporter();
    }


}
